package com.example.myapp.fragment;

import com.example.myapp.R;
import com.example.myapp.pay.ZfbPayActivity;
import com.example.myapp.webView.ui.WebViewToHtmlActivity;
import com.example.myapp.webView.ui.WebViewToUrlActivity;

import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

public class ContentFragment extends Fragment implements OnClickListener {
	View view=null;
	Button btn_content_webView_url,btn_content_webView_html,btn_content_pay;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		view=inflater.inflate(R.layout.fragment_content, container, false);
		initView();
		return view;
	}
	private void initView() {
		// TODO Auto-generated method stub
		btn_content_webView_url=(Button) view.findViewById(R.id.btn_content_webView_url);
		btn_content_webView_html=(Button) view.findViewById(R.id.btn_content_webView_html);
		btn_content_pay=(Button) view.findViewById(R.id.btn_content_pay);
		btn_content_webView_html.setOnClickListener(this);
		btn_content_webView_url.setOnClickListener(this);
		btn_content_pay.setOnClickListener(this);
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent intent = new Intent();
		switch (v.getId()) {
		case R.id.btn_content_webView_html:
			intent.setClass(getActivity(), WebViewToHtmlActivity.class);
			startActivity(intent);
			getActivity().finish();
			break;
		case R.id.btn_content_webView_url:
			intent.setClass(getActivity(), WebViewToUrlActivity.class);
			startActivity(intent);
			getActivity().finish();
			break;
		case R.id.btn_content_pay:
			intent.setClass(getActivity(), ZfbPayActivity.class);
			startActivity(intent);
			getActivity().finish();
			break;
		default:
			break;
		}
	}
}
